using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Xml;

namespace Mdv.wssAddins.wss
{
    /// <summary>
    /// http://msdn.microsoft.com/en-us/library/aa543767.aspx
    /// </summary>
    [DefaultProperty("ID")]
    public class wssContentTypeRef : Model
    {
        #region Properties
        private String _id;
        [Browsable(true)]
        [Category("Required")]
        [Description("Specifies the ID of the content type. ")]
        public String ID
        {
            get { return _id; }
            set
            {
                if (String.IsNullOrEmpty(value))
                    throw new ArgumentException("Specify a non-empty argument.", "ID");
                _id = value;
                NodeRenamed();
            }
        }
        #endregion
        public override string ToString()
        {
            return ID;
        }
        public override void ConstructMap()
        {
            PropertiesToXmlMap.Add("ID", "ID");
        }
        public wssContentTypeRef()
        {
            Actions = new List<Action>();
            Actions.Add(new Action("Delete", this.Delete));
        }
        public void Delete(ModelEventArgs e)
        {
            NodeDeleted("ID");
        }
    }
}